﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using Luna小店.UC.项目成果管理.在制品管理.service;
using Luna小店.UC.项目成果管理.service;

namespace Luna小店.UC.项目成果管理
{
    public partial class Form项目成果提交 : DevExpress.XtraEditors.XtraForm
    {
        private DTO项目成果提交 DTO项目成果提交 = new DTO项目成果提交();
        public Form项目成果提交(DTO项目成果提交 DTO项目成果提交)
        {
            InitializeComponent();
            this.DTO项目成果提交 = DTO项目成果提交;
        }

        private void textBox扫描_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyValue == 13)
            {
                if (String.IsNullOrEmpty(this.textBox扫描.Text))
                {
                    MessageBox.Show("无扫描信息");
                    return;
                }
                this.DTO项目成果提交.mnemonic = this.textBox扫描.Text;
                try
                {
                    项目成果Service.post项目成果提交(this.DTO项目成果提交);
                    MessageBox.Show("完成");
                    this.Close();
                }
                catch (Exception exception)
                {
                    MessageBox.Show(exception.Message);
                }
                
            }
        }
    }
}